﻿<script type="text/javascript">
    function on_upload_success(file, data) {
        var json = $.parseJSON(data)
        $(this).bjuiajax('ajaxDone', json).navtab('refresh').dialog('closeCurrent');
        //$.CurrentNavtab.refresh();
     //   if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
      //      $.refresh('filemanager_filemanager_filemanager');
      //  }
    }
</script>
<div class="bjui-pageHeader">
    <div class="pull-left" style="line-height: 25px;">
        <#if parentPath??>
        <a href="/filemanager/index.htm?path=${parentPath}" data-title="文件管理" data-toggle="navtab" data-id="filemanager_filemanager_filemanager">返回上一级</a> |
        <a href="/filemanager/index.htm" data-title="文件管理" data-toggle="navtab" data-id="filemanager_filemanager_filemanager">全部文件</a>
        <#list listPaths as path>
            &gt;
            <#if path_index+1 lt listPaths?size>
                <a href="/filemanager/index.htm?path=${path.path}" data-title="文件管理" data-toggle="navtab" data-id="filemanager_filemanager_filemanager">${path.name}</a>
            <#else>
                ${path.name}
            </#if>
         </#list>
        <#else>
        全部文件
        </#if>
    </div>
    <div class="pull-right">
        <@s.oauth pluginKey="filemanager" moduleKey="filemanager" authorities="file.manager.mkdir">
            <#include "mkdir-dialog.ftl"/>
        </@s.oauth>
        <@s.oauth pluginKey="filemanager" moduleKey="filemanager" authorities="file.manager.upload">
        <#include "upload-dialog.ftl"/>
        </@s.oauth>
        <@s.oauth pluginKey="filemanager" moduleKey="filemanager" authorities="file.manager.compress">
            <#include "compress-dialog.ftl"/>
        </@s.oauth>
        <@s.oauth pluginKey="filemanager" moduleKey="filemanager" authorities="file.manager.delete">

        <a type="button" class="btn btn-default" href="/filemanager/delete.ajax?path=${relativePath!''}" data-icon="remove"
            data-toggle="doajaxchecked" data-confirm-msg="确定要删除选中项吗？" data-idname="fileNames" data-group="fileNames">
             删除
        </a>
        </@s.oauth>
        <a type="button" class="btn btn-default" data-icon="refresh" onclick="$(this).navtab('refresh')">
             刷新
        </a>
    </div>
</div>

<div class="bjui-pageContent tableContent">
    <table data-toggle="tablefixed">
        <thead>
        <tr>
            <th width="110">
                <input type="checkbox" class="checkboxCtrl" data-group="fileNames" data-toggle="icheck">
                操作
            </th>
            <th>文件名</th>
            <th>权限</th>
            <th width="150">最后修改</th>
            <th>类型</th>
            <th width="100">大小</th>
        </tr>
        </thead>
        <tbody>
        <#list listItems as row>
        <tr target="row_id" rel="${row.name}">
            <td>
                <input type="checkbox" name="fileNames" data-toggle="icheck" value="${row.name}">
                <#if row.directory>
                    <a href="/filemanager/index.htm?path=${row.path}" data-title="文件管理" data-toggle="navtab"  data-icon="folder-open"
                    data-id="filemanager_filemanager_filemanager" class="btn btn-default btn-sm">打开</a>
                <#else>
                    <a href="/filemanager/edit.htm?path=${row.path}" class="btn btn-default btn-sm" data-icon="edit"
                        data-title="${row.name}"
                        data-toggle="navtab"
                        data-id="filemanager_filemanager_${row.name}"
                        data-external="true"
                        >编辑</a>
                    <a href="/filemanager/download.htm?path=${row.path}" target="_blank"  class="btn btn-default btn-sm" data-icon="download">下载</a>
                </#if>
            </td>
            <td>
                <#if row.directory>
                    <a href="/filemanager/index.htm?path=${row.path}" data-title="文件管理" data-toggle="navtab" data-id="filemanager_filemanager_filemanager">${row.name}</a>
                <#else>
                    ${row.name}
                </#if>
            </td>
            <td>${row.permissions}</td>
            <td>${row.lastModifiedTime?datetime}</td>
            <td>${row.mimeType!'-'}</td>
            <td>${row.size}</td>
        </tr>
        </#list>
        </tbody>
    </table>
</div>